<?php

class Ynadvsearch_Widget_SearchFieldController extends Engine_Content_Widget_Abstract
{
	public function indexAction()
	{
		$values = Zend_Controller_Front::getInstance()->getRequest()->getParams();
		if (isset($values['submit']) && isset($values['query']) && $values['query'] != '') {
			$this->view->query = $values['query'];
		}
		elseif (isset($values['is_search']) && $values['is_search'] == 1 && isset($values['query']) && $values['query'] != '') {
			$this->view->query = $values['query'];
		}
		elseif (isset($values['phrase']) && $values['phrase'] != '') {
			$this->view->query = $values['phrase'];
		}
	}
}
